.message-container {
    margin-bottom: 20px;
}

.message {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    gap: 12px;
    animation: fadeIn 0.3s ease-in-out; /* 添加淡入动画 */
}

.bot-container .message:last-child {
    margin-bottom: 20px;
}

/* 头像样式 */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb); /* 渐变背景 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* 通用内容区 */
.content {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    line-height: 1.6;
    white-space: pre-wrap !important;
    overflow: hidden !important;
    max-width: var(--contentWidth);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}
.content:hover {
    transform: translateY(-1px);
}

/* 用户消息（右侧深色气泡） */
.user-message .content {
    width: fit-content;
    background: linear-gradient(135deg, #4a90e2, #357ab7);
    color: #fff;
    white-space: pre-wrap !important;
    align-self: flex-end;
}

/* AI 消息（左侧浅色气泡） */
.message.bot-message .content {
    background-color: #f5f6f7;
    color: #222;
    margin-left: 52px;
    white-space: pre-wrap !important;
}

/* AI 思考中消息 */
.message.thinking-message {
    margin-left: 0;
    flex-direction: column;
}
.message.thinking-message .content {
    background-color: #f0f0f3;
    color: #555;
    font-style: italic;
    border-left: 3px solid #999;
    margin-left: 52px;
    padding: 12px 15px;
    border-radius: 0 12px 12px 0;
    animation: pulse 1.5s infinite;
}

/* 思考提示头 */
.thinking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    margin-left: 52px;
}
.toggle-thinking {
    cursor: pointer;
    user-select: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #eaeaea;
    font-size: 12px;
}
.thinking-title {
    color: #666;
    font-size: 14px;
}

.message.thinking-message.collapsed .content {
    display: none;
}

.message.thinking-message .avatar {
    margin-bottom: -40px;
}

/* 禁用状态 */
textarea:disabled, button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 动画效果 */
@keyframes fadeIn {
    from {opacity: 0; transform: translateY(5px);}
    to {opacity: 1; transform: translateY(0);}
}
@keyframes pulse {
    0% {opacity: 0.6;}
    50% {opacity: 1;}
    100% {opacity: 0.6;}
}
